<?php
/**
 * Klasse voor voor managen van reisfilter.
 *
 * @author Jehannes Stellingwerf
 */
if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 

class ReisFilter {
    public function getFilterBlob(){                
        $ci =& get_instance();
		$ci->load->model('reisfilter_model');
        
        //Lege optie toevoegen
        $reisFilterArr = $this->addEmptyOption($ci->reisfilter_model->getReisTypes());
        
        $viewString = $ci->load->view('reisfilter_view', array(
            'reistype'=>$reisFilterArr,
            'continenten'=>$this->addEmptyOption($ci->reisfilter_model->getContinenten()),
            'landen'=>$this->addEmptyOption($ci->reisfilter_model->getLanden())
        ), true);
        
        return $viewString;
    }
    
    private function addEmptyOption($arr){
        $arr = array_reverse($arr, true);
        $arr[''] = '';
        $arr = array_reverse($arr, true);        
        return $arr;
    }
}

?>
